<template>
  <div class="app-container page-container right-side-dialog">
    <!-- 搜索条件 -->
    <div class="header-search single_line">
      <el-form ref="search_form" :model="search" :inline="true" label-width="80px">
        <div class="form-area">
          <div class="search_view">
            <el-form-item>
              <el-input v-model="search.hxy_scl_name" placeholder="请选择学校" readonly @focus="schoolVisible = true" />
            </el-form-item>
            <el-form-item>
              <el-input v-model="search.equ_no" placeholder="请输入设备编号" />
            </el-form-item>
            <div class="btn-area">
              <span class="spp-btn spp-btn-primary" @click="searchSubmit()">搜索</span>
              <span class="spp-btn" @click="resetData()">重置</span>
            </div>
          </div>
        </div>
      </el-form>
    </div>
    <!-- 设备表格 -->
    <div class="content_view">
      <el-row>
        <el-col :span="4" class="content_left" :style="{height: height-20 + 'px'}">
          <div style="padding: 0 8px;">设备类型</div>
          <div :class="{ active: select_equip_type==='att' }" @click="select_equip_type='att'">
            <img src="../../../assets/images/eq_att.png" alt="">
            <span>考勤机</span>
          </div>
          <div :class="{ active: select_equip_type==='tel' }" @click="select_equip_type='tel'">
            <img src="../../../assets/images/eq_tel.png" alt="">
            <span>电话机</span>
          </div>
          <div :class="{ active: select_equip_type==='camera' }" @click="select_equip_type='camera'">
            <img src="../../../assets/images/eq_camera.png" alt="">
            <span>摄像头</span>
          </div>
          <div :class="{ active: select_equip_type==='meal' }" @click="select_equip_type='meal'">
            <img src="../../../assets/images/eq_meal.png" alt="">
            <span>售饭机</span>
          </div>
          <div :class="{ active: select_equip_type==='led' }" @click="select_equip_type='led'">
            <img src="../../../assets/images/eq_led.png" alt="">
            <span>LED大屏</span>
          </div>
        </el-col>
        <el-col :span="20" :style="{height: height-20 + 'px'}">
          <!-- 考勤机 -->
          <div v-if="select_equip_type === 'att'" class="content_right">
            <div class="main-header">
              <el-row :gutter="20">
                <el-col :span="10" class="left">
                  <span>设备列表</span>
                  <span style="color:#436DB2;">考勤机</span>
                </el-col>
                <el-col :span="14" class="right">
                  <span v-if="auth.att_save != -1" class="spp-btn spp-btn-primary" @click="setEquipEditVisible()">添加设备</span>
                </el-col>
              </el-row>
            </div>
            <el-table ref="table" :data="att_equip_paginate_data" :height="height-130" size="mini" stripe>
              <el-table-column label="序号" type="index" width="60" />
              <el-table-column label="设备名称" prop="equ_name" min-width="150" align="left" />
              <el-table-column label="设备编号" prop="equ_no" min-width="150" align="left" />
              <el-table-column label="设备类型" prop="equ_type" min-width="150" align="left" />
              <el-table-column label="设备厂商" prop="equ_vendor" min-width="150" align="left" />
              <el-table-column label="在线状态" min-width="100" align="left" >
                <template slot-scope="scope">
                  <div>{{ scope.row.online_flag ==='1'?'在线':'离线' }}</div>
                </template>
              </el-table-column>
              <el-table-column label="操作" min-width="150" fixed="right" align="left" >
                <template slot-scope="scope">
                  <el-button v-if="auth.att_update != -1" type="text" @click="getAttEquipDetail(scope.row.equ_id)">修改</el-button>
                  <el-button v-if="auth.att_delete != -1" type="text" @click="attEquipDelete(scope.row.equ_id)">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
            <pagination v-show="att_total>0" :total="att_total" :page.sync="att_page" :limit.sync="att_page_size" @pagination="getAttEquipPaginateData" />
          </div>
          <!-- 电话机 -->
          <div v-if="select_equip_type === 'tel'" class="content_right">
            <div class="main-header">
              <el-row :gutter="20">
                <el-col :span="10" class="left">
                  <span>设备列表</span>
                  <span style="color:#436DB2;">电话机</span>
                </el-col>
                <el-col :span="14" class="right">
                  <span v-if="auth.tel_save != -1" class="spp-btn spp-btn-primary" @click="setEquipEditVisible()">添加设备</span>
                </el-col>
              </el-row>
            </div>
            <el-table ref="table" :data="tel_equip_paginate_data" :height="height-130" size="mini" stripe>
              <el-table-column label="序号" type="index" width="60" />
              <el-table-column label="设备名称" prop="equ_name" min-width="150" align="left" />
              <el-table-column label="设备编号" prop="equ_no" min-width="150" align="left" />
              <el-table-column label="设备类型" prop="equ_type" min-width="150" align="left" />
              <el-table-column label="设备厂商" prop="equ_vendor" min-width="150" align="left" />
              <el-table-column label="在线状态" min-width="100" align="left">
                <template slot-scope="scope">
                  <div>{{ scope.row.online_flag ==='1'?'在线':'离线' }}</div>
                </template>
              </el-table-column>
              <el-table-column label="操作" width="150" min-width="150" fixed="right" align="left">
                <template slot-scope="scope">
                  <el-button v-if="auth.tel_update != -1" type="text" @click="getTelEquipDetail(scope.row.equ_id)">修改</el-button>
                  <el-button v-if="auth.tel_delete != -1" type="text" @click="telEquipDelete(scope.row.equ_id)">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
            <pagination v-show="tel_total>0" :total="tel_total" :page.sync="tel_page" :limit.sync="tel_page_size" @pagination="getTelEquipPaginateData" />
          </div>
          <!-- 摄像头 -->
          <div v-if="select_equip_type === 'camera'" class="content_right">
            <div class="main-header">
              <el-row :gutter="20">
                <el-col :span="10" class="left">
                  <span>设备列表</span>
                  <span style="color:#436DB2;">摄像头</span>
                </el-col>
                <el-col :span="14" class="right">
                  <span v-if="auth.camera_save != -1" class="spp-btn spp-btn-primary" @click="setEquipEditVisible()">添加设备</span>
                </el-col>
              </el-row>
            </div>
            <el-table ref="table" :data="camera_equip_paginate_data" :height="height-130" size="mini" stripe>
              <el-table-column label="序号" type="index" width="60" />
              <el-table-column label="设备名称" prop="equ_name" min-width="150" align="left" />
              <el-table-column label="设备编号" prop="equ_no" min-width="150" align="left" />
              <el-table-column label="设备类型" prop="equ_type" min-width="150" align="left" />
              <el-table-column label="设备厂商" prop="equ_vendor" min-width="150" align="left" />
              <el-table-column label="在线状态" min-width="150" align="left" >
                <template slot-scope="scope" min-width="100" align="left" >
                  <div>{{ scope.row.online_flag ==='1'?'在线':'离线' }}</div>
                </template>
              </el-table-column>
              <el-table-column label="操作" min-width="150" fixed="right" align="left">
                <template slot-scope="scope">
                  <el-button v-if="auth.camera_update != -1" type="text" @click="getCameraEquipDetail(scope.row.equ_id)">修改</el-button>
                  <el-button v-if="auth.camera_delete != -1" type="text" @click="cameraEquipDelete(scope.row.equ_id)">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
            <pagination v-show="camera_total>0" :total="camera_total" :page.sync="camera_page" :limit.sync="camera_page_size" @pagination="getCameraEquipPaginateData" />
           </div>
          <!-- 售饭机 -->
          <div v-if="select_equip_type === 'meal'" class="content_right">
            <div class="main-header">
              <el-row :gutter="20">
                <el-col :span="10" class="left">
                  <span>设备列表</span>
                  <span style="color:#436DB2;">售饭机</span>
                </el-col>
                <el-col :span="14" class="right">
                  <span v-if="auth.meal_save != -1" class="spp-btn spp-btn-primary" @click="setEquipEditVisible()">添加设备</span>
                </el-col>
              </el-row>
            </div>
            <el-table ref="table" :data="meal_equip_paginate_data" :height="height-130" size="mini" stripe>
              <el-table-column label="序号" type="index" width="60" />
              <el-table-column label="设备名称" prop="equ_name" min-width="150" align="left" />
              <el-table-column label="设备编号" prop="equ_no" min-width="150" align="left" />
              <el-table-column label="设备类型" prop="equ_type" min-width="150" align="left" />
              <el-table-column label="设备厂商" prop="equ_vendor" min-width="150" align="left" />
              <el-table-column label="在线状态" min-width="100" align="left">
                <template slot-scope="scope">
                  <div>{{ scope.row.online_flag ==='1'?'在线':'离线' }}</div>
                </template>
              </el-table-column>
              <el-table-column label="操作" min-width="150" fixed="right" align="left">
                <template slot-scope="scope">
                  <el-button v-if="auth.meal_update != -1" type="text" @click="getMealEquipDetail(scope.row.equ_id)">修改</el-button>
                  <el-button v-if="auth.meal_delete != -1" type="text" @click="mealEquipDelete(scope.row.equ_id)">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
            <pagination v-show="meal_total>0" :total="meal_total" :page.sync="meal_page" :limit.sync="meal_page_size" @pagination="getMealEquipPaginateData" />
          </div>
          <!-- LED大屏 -->
          <div v-if="select_equip_type === 'led'" class="content_right">
            <div class="main-header">
              <el-row :gutter="20">
                <el-col :span="10" class="left">
                  <span>设备列表</span>
                  <span style="color:#436DB2;">LED大屏</span>
                </el-col>
                <el-col :span="14" class="right">
                  <span v-if="auth.led_save != -1" class="spp-btn spp-btn-primary" @click="setEquipEditVisible()">添加设备</span>
                </el-col>
              </el-row>
            </div>
            <el-table ref="table" :data="led_equip_paginate_data" :height="height-130" size="mini" stripe>
              <el-table-column label="序号" type="index" width="60" />
              <el-table-column label="设备名称" prop="equ_name" min-width="150" align="left" />
              <el-table-column label="设备编号" prop="equ_no" min-width="150" align="left" />
              <el-table-column label="设备类型" prop="equ_type" min-width="150" align="left" />
              <el-table-column label="设备厂商" prop="equ_vendor" min-width="150" align="left" />
              <el-table-column label="在线状态" min-width="100" align="left">
                <template slot-scope="scope">
                  <div>{{ scope.row.online_flag ==='1'?'在线':'离线' }}</div>
                </template>
              </el-table-column>
              <el-table-column label="操作" min-width="150" fixed="right" align="left">
                <template slot-scope="scope">
                  <el-button v-if="auth.led_update != -1" type="text" @click="getLedEquipDetail(scope.row.equ_id)">修改</el-button>
                  <el-button v-if="auth.led_delete != -1" type="text" @click="ledEquipDelete(scope.row.equ_id)">删除</el-button>
                </template>
              </el-table-column>
            </el-table>
            <pagination v-show="led_total>0" :total="led_total" :page.sync="led_page" :limit.sync="led_page_size" @pagination="getLedEquipPaginateData" />
          </div>
        </el-col>
      </el-row>
    </div>
    <!-- 选择学校 -->
    <el-dialog title="选择学校" :visible.sync="schoolVisible" :close-on-click-modal="false" width="720px" class="school_view">
      <el-scrollbar wrap-class="vertical_scrollbar" :style="{height: height + 'px'}">
        <SelectSchool @selectSchool="selectSchool" />
      </el-scrollbar>
    </el-dialog>
    <!-- 新增编辑设备 -->
    <el-dialog :title="equip_edit_form.title" :visible.sync="equipEditVisible" :close-on-click-modal="false" width="720px">
      <el-scrollbar wrap-class="vertical_scrollbar" :style="{height: height + 'px'}">
        <el-form ref="equip_edit_form" label-width="20px" :model="equip_edit_form">
          <!-- 考勤机 -->
          <div v-if="select_equip_type === 'att'">
            <el-row>
              <el-col :span="12">
                <el-form-item prop="equ_type">
                  <div class="form_lable">设备类型</div>
                  <el-select v-model="equip_edit_form.equ_type" placeholder="请选择设备类型">
                    <el-option v-for="(value, key, index) in equ_type_att_dic" :key="index" :label="value" :value="key"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="att_type">
                  <div class="form_lable">考勤类型</div>
                  <el-select v-model="equip_edit_form.att_type" placeholder="请选择考勤类型">
                    <el-option v-for="(value, key, index) in att_type_dic" :key="index" :label="value" :value="key"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="att_inout">
                  <div class="form_lable">进出标识</div>
                  <el-select v-model="equip_edit_form.att_inout" placeholder="请选择进出标识">
                    <el-option v-for="(value, key, index) in att_inout_dic" :key="index" :label="value" :value="key"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="equ_provider">
                  <div class="form_lable">设备提供方</div>
                  <el-select v-model="equip_edit_form.equ_provider" placeholder="请选择设备提供方">
                    <el-option v-for="(value, key, index) in equ_provider_dic" :key="index" :label="value" :value="key"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="equ_vendor">
                  <div class="form_lable">设备厂商</div>
                  <el-select v-model="equip_edit_form.equ_vendor" placeholder="请选择设备厂商">
                    <el-option v-for="(value, key, index) in equ_vendor_dic" :key="index" :label="value" :value="key"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="equ_name">
                  <div class="form_lable">设备名称</div>
                  <el-input v-model="equip_edit_form.equ_name" placeholder="请输入设备名称" />
                </el-form-item>
              </el-col>
              <el-col :span="24">
                <el-form-item prop="equ_desc">
                  <div class="form_lable">设备描述</div>
                  <el-input v-model="equip_edit_form.equ_desc" type="textarea" />
                </el-form-item>
              </el-col>
              <el-col :span="24">
                <el-form-item prop="equ_position">
                  <div class="form_lable">安装位置</div>
                  <el-input v-model="equip_edit_form.equ_position" placeholder="请输入安装位置" />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="apn_sim">
                  <div class="form_lable">APN卡号</div>
                  <el-input v-model="equip_edit_form.apn_sim" placeholder="请输入APN卡号" />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="server_ip">
                  <div class="form_lable">服务器IP</div>
                  <el-input v-model="equip_edit_form.server_ip" placeholder="请输入服务器IP" />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="server_port">
                  <div class="form_lable">服务器端口</div>
                  <el-input v-model="equip_edit_form.server_port" placeholder="请输入服务器端口" />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="soft_ver">
                  <div class="form_lable">软件版本号</div>
                  <el-input v-model="equip_edit_form.soft_ver" placeholder="请输入软件版本号" />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="hard_ver">
                  <div class="form_lable">硬件版本号</div>
                  <el-input v-model="equip_edit_form.hard_ver" placeholder="请输入硬件版本号" />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="real_exists_flag">
                  <div class="form_lable">真实存在</div>
                  <el-select v-model="equip_edit_form.real_exists_flag" placeholder="请选择">
                    <el-option label="是" value="1"></el-option>
                    <el-option label="否" value="2"></el-option>
                    <el-option label="未登记" value="0"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
          </div>
          <!-- 电话机 -->
          <div v-if="select_equip_type === 'tel'">
            <el-row>
              <el-col :span="12">
                <el-form-item prop="equ_type">
                  <div class="form_lable">设备类型</div>
                  <el-select v-model="equip_edit_form.equ_type" placeholder="请选择设备类型">
                    <el-option v-for="(value, key, index) in equ_type_tel_dic" :key="index" :label="value" :value="key"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="equ_provider">
                  <div class="form_lable">设备提供方</div>
                  <el-select v-model="equip_edit_form.equ_provider" placeholder="请选择设备提供方">
                    <el-option v-for="(value, key, index) in equ_provider_dic" :key="index" :label="value" :value="key"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="equ_vendor">
                  <div class="form_lable">设备厂商</div>
                  <el-select v-model="equip_edit_form.equ_vendor" placeholder="请选择设备厂商">
                    <el-option v-for="(value, key, index) in equ_vendor_dic" :key="index" :label="value" :value="key"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="equ_name">
                  <div class="form_lable">设备名称</div>
                  <el-input v-model="equip_edit_form.equ_name" placeholder="请输入设备名称" />
                </el-form-item>
              </el-col>
              <el-col :span="24">
                <el-form-item prop="equ_desc">
                  <div class="form_lable">设备描述</div>
                  <el-input v-model="equip_edit_form.equ_desc" type="textarea" />
                </el-form-item>
              </el-col>
              <el-col :span="24">
                <el-form-item prop="equ_position">
                  <div class="form_lable">安装位置</div>
                  <el-input v-model="equip_edit_form.equ_position" placeholder="请输入安装位置" />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="apn_sim">
                  <div class="form_lable">APN卡号</div>
                  <el-input v-model="equip_edit_form.apn_sim" placeholder="请输入APN卡号" />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="server_ip">
                  <div class="form_lable">服务器IP</div>
                  <el-input v-model="equip_edit_form.server_ip" placeholder="请输入服务器IP" />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="server_port">
                  <div class="form_lable">服务器端口</div>
                  <el-input v-model="equip_edit_form.server_port" placeholder="请输入服务器端口" />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="soft_ver">
                  <div class="form_lable">软件版本号</div>
                  <el-input v-model="equip_edit_form.soft_ver" placeholder="请输入软件版本号" />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="hard_ver">
                  <div class="form_lable">硬件版本号</div>
                  <el-input v-model="equip_edit_form.hard_ver" placeholder="请输入硬件版本号" />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="real_exists_flag">
                  <div class="form_lable">真实存在</div>
                  <el-select v-model="equip_edit_form.real_exists_flag" placeholder="请选择">
                    <el-option label="是" value="1"></el-option>
                    <el-option label="否" value="2"></el-option>
                    <el-option label="未登记" value="0"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="permit_att">
                  <div class="form_lable">刷卡签到</div>
                  <el-select v-model="equip_edit_form.permit_att" placeholder="请选择">
                    <el-option label="允许" value="1"></el-option>
                    <el-option label="不允许" value="0"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
          </div>
          <!-- 摄像头 -->
          <div v-if="select_equip_type === 'camera'">
             <el-row>
              <el-col :span="12">
                <el-form-item prop="equ_type">
                  <div class="form_lable">设备类型</div>
                  <el-select v-model="equip_edit_form.equ_type" placeholder="请选择设备类型">
                    <el-option v-for="(value, key, index) in equ_type_camera_dic" :key="index" :label="value" :value="key"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="equ_provider">
                  <div class="form_lable">设备提供方</div>
                  <el-select v-model="equip_edit_form.equ_provider" placeholder="请选择设备提供方">
                    <el-option v-for="(value, key, index) in equ_provider_dic" :key="index" :label="value" :value="key"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="equ_vendor">
                  <div class="form_lable">设备厂商</div>
                  <el-select v-model="equip_edit_form.equ_vendor" placeholder="请选择设备厂商">
                    <el-option v-for="(value, key, index) in equ_vendor_dic" :key="index" :label="value" :value="key"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="gra_id">
                  <div class="form_lable">年级</div>
                  <el-select v-model="edit_camera_gra_id" clearable placeholder="请选择">
                    <el-option v-for="(item, k) in gra_dic" :key="k" :label="item.gra_name" :value="k" />
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="cls_id">
                  <div class="form_lable">班级</div>
                  <el-select v-model="equip_edit_form.cls_id" clearable placeholder="请选择">
                    <el-option v-for="item in edit_camera_equip_class_dic" :key="item.hxy_cls_id" :label="item.cls_name" :value="item.hxy_cls_id" />
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="equ_name">
                  <div class="form_lable">设备名称</div>
                  <el-input v-model="equip_edit_form.equ_name" placeholder="请输入设备名称" />
                </el-form-item>
              </el-col>
              <el-col :span="24">
                <el-form-item prop="equ_desc">
                  <div class="form_lable">设备描述</div>
                  <el-input v-model="equip_edit_form.equ_desc" type="textarea" />
                </el-form-item>
              </el-col>
              <el-col :span="24">
                <el-form-item prop="equ_position">
                  <div class="form_lable">安装位置</div>
                  <el-input v-model="equip_edit_form.equ_position" placeholder="请输入安装位置" />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="rtsp">
                  <div class="form_lable">rtsp地址</div>
                  <el-input v-model="equip_edit_form.rtsp" placeholder="请输入rtsp地址" />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="hls">
                  <div class="form_lable">hls地址</div>
                  <el-input v-model="equip_edit_form.hls" placeholder="请输入hls地址" />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="rtmp">
                  <div class="form_lable">rtmp地址</div>
                  <el-input v-model="equip_edit_form.rtmp" placeholder="请输入rtmp地址" />
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="camera_status">
                  <div class="form_lable">工作状态</div>
                  <el-select v-model="equip_edit_form.camera_status" placeholder="请选择">
                    <el-option label="开启" value="1"></el-option>
                    <el-option label="关闭" value="0"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="camera_use_type">
                  <div class="form_lable">应用场景</div>
                  <el-select v-model="equip_edit_form.camera_use_type" placeholder="请选择应用场景">
                    <el-option v-for="(value, key, index) in camera_use_type_dic" :key="index" :label="value" :value="key"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="tea_control_flag">
                  <div class="form_lable">教师操作权限</div>
                  <el-select v-model="equip_edit_form.tea_control_flag" placeholder="请选择">
                    <el-option label="允许" value="1"></el-option>
                    <el-option label="禁止" value="0"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="camera_scheme">
                  <div class="form_lable">校视通方案</div>
                  <el-select v-model="equip_edit_form.camera_scheme" placeholder="请选择校视通方案">
                    <el-option v-for="(value, key, index) in camera_scheme_dic" :key="index" :label="value" :value="key"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
          </div>
          <!-- 售饭机 -->
          <div v-if="select_equip_type === 'meal'">
            <el-row>
              <el-col :span="12">
                <el-form-item prop="equ_type">
                  <div class="form_lable">设备类型</div>
                  <el-select v-model="equip_edit_form.equ_type" placeholder="请选择设备类型">
                    <el-option v-for="(value, key, index) in equ_type_meal_dic" :key="index" :label="value" :value="key"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="equ_provider">
                  <div class="form_lable">设备提供方</div>
                  <el-select v-model="equip_edit_form.equ_provider" placeholder="请选择设备提供方">
                    <el-option v-for="(value, key, index) in equ_provider_dic" :key="index" :label="value" :value="key"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="equ_vendor">
                  <div class="form_lable">设备厂商</div>
                  <el-select v-model="equip_edit_form.equ_vendor" placeholder="请选择设备厂商">
                    <el-option v-for="(value, key, index) in equ_vendor_dic" :key="index" :label="value" :value="key"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="equ_name">
                  <div class="form_lable">设备名称</div>
                  <el-input v-model="equip_edit_form.equ_name" placeholder="请输入设备名称" />
                </el-form-item>
              </el-col>
              <el-col :span="24">
                <el-form-item prop="equ_desc">
                  <div class="form_lable">设备描述</div>
                  <el-input v-model="equip_edit_form.equ_desc" type="textarea" />
                </el-form-item>
              </el-col>
              <el-col :span="24">
                <el-form-item prop="equ_position">
                  <div class="form_lable">安装位置</div>
                  <el-input v-model="equip_edit_form.equ_position" placeholder="请输入安装位置" />
                </el-form-item>
              </el-col>
            </el-row>
          </div>
          <!-- LED大屏 -->
          <div v-if="select_equip_type === 'led'">
             <el-row>
              <el-col :span="12">
                <el-form-item prop="equ_type">
                  <div class="form_lable">设备类型</div>
                  <el-select v-model="equip_edit_form.equ_type" placeholder="请选择设备类型">
                    <el-option v-for="(value, key, index) in equ_type_led_dic" :key="index" :label="value" :value="key"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="equ_provider">
                  <div class="form_lable">设备提供方</div>
                  <el-select v-model="equip_edit_form.equ_provider" placeholder="请选择设备提供方">
                    <el-option v-for="(value, key, index) in equ_provider_dic" :key="index" :label="value" :value="key"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="equ_vendor">
                  <div class="form_lable">设备厂商</div>
                  <el-select v-model="equip_edit_form.equ_vendor" placeholder="请选择设备厂商">
                    <el-option v-for="(value, key, index) in equ_vendor_dic" :key="index" :label="value" :value="key"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="equ_name">
                  <div class="form_lable">设备名称</div>
                  <el-input v-model="equip_edit_form.equ_name" placeholder="请输入设备名称" />
                </el-form-item>
              </el-col>
              <el-col :span="24">
                <el-form-item prop="equ_desc">
                  <div class="form_lable">设备描述</div>
                  <el-input v-model="equip_edit_form.equ_desc" type="textarea" />
                </el-form-item>
              </el-col>
              <el-col :span="24">
                <el-form-item prop="equ_position">
                  <div class="form_lable">安装位置</div>
                  <el-input v-model="equip_edit_form.equ_position" placeholder="请输入安装位置" />
                </el-form-item>
              </el-col>
            </el-row>
          </div>
        </el-form>
      </el-scrollbar>
      <div class="dialog-btn" style="text-align: right">
        <span class="spp-btn" @click="equipEditVisible = false">取消</span>
        <span class="spp-btn spp-btn-primary" @click="equipEditSubmit()">保存</span>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import { attPaginate, attSave, attDetail, attUpdate, attDelete, telPaginate, telSave, telDetail, telUpdate, telDelete, cameraPaginate, cameraSave, cameraDetail, cameraUpdate, cameraDelete, mealPaginate, mealSave, mealDetail, mealUpdate, mealDelete, ledPaginate, ledSave, ledDetail, ledUpdate, ledDelete } from '@/api/pajx/pajx/equip'
import { equ_type_att, att_type, att_inout, equ_provider, equ_vendor, equ_type_tel, equ_type_camera, gra, camera_use_type, camera_scheme, equ_type_meal, equ_type_led } from '@/api/public'
import { formatClass } from '@/utils/index'
import { mapState } from 'vuex'
import SelectSchool from '@/components/SelectSchool'
import Pagination from '@/components/Pagination'
export default {
  name: 'PajxEquip',
  components: { SelectSchool, Pagination },
  data() {
    return {
      height: window.innerHeight - 135,
      auth: {},
      schoolVisible: false,
      search: {
        hxy_scl_id: '',
        hxy_scl_name: '',
        equ_no: ''
      },
      select_equip_type: 'att',
      equipEditVisible: false,
      equip_edit_form: {
        title: '新增考勤机',
        type: 'add',
        hxy_scl_id: '',
        att_type: '',
        att_inout: '',
        equ_provider: '',
        equ_vendor: '',
        equ_name: '',
        equ_desc: '',
        equ_position: '',
        apn_sim: '',
        apn_sim: '',
        server_port: '',
        soft_ver: '',
        hard_ver: '',
        real_exists_flag: '1',
        equ_id: '',
        permit_att: '0',
        gra_id: '',
        cls_id: '',
        rtsp: '',
        hls: '',
        rtmp: '',
        camera_status: '0',
        camera_use_type: '',
        tea_control_flag: '',
        camera_scheme: ''
      },
      equ_type_att_dic: [],
      att_type_dic: [],
      att_inout_dic: [],
      equ_provider_dic: [],
      equ_vendor_dic: [],
      equ_type_tel_dic: [],
      equ_type_camera_dic: [],
      gra_dic: [],
      edit_camera_equip_class_dic: [],
      camera_use_type_dic: [],
      camera_scheme_dic: [],
      equ_type_meal_dic: [],
      equ_type_led_dic: [],
      edit_camera_gra_id: '',
      att_page: 1,
      att_page_size: 20,
      att_total: 0,
      att_equip_paginate_data: [],
      tel_page: 1,
      tel_page_size: 20,
      tel_total: 0,
      tel_equip_paginate_data: [],
      camera_page: 1,
      camera_page_size: 20,
      camera_total: 0,
      camera_equip_paginate_data: [],
      meal_page: 1,
      meal_page_size: 20,
      meal_total: 0,
      meal_equip_paginate_data: [],
      led_page: 1,
      led_page_size: 20,
      led_total: 0,
      led_equip_paginate_data: []
    }
  },
  computed: {
    ...mapState({
      permission: state => state.permission.permission
    })
  },
  watch: {
    equipEditVisible(val) {
      if (val) {
        if(this.select_equip_type === 'att'){
          this.equip_edit_form.title = this.equip_edit_form.type==='add'?'新增考勤机':'编辑考勤机'
        }
        if(this.select_equip_type === 'tel'){
          this.equip_edit_form.title = this.equip_edit_form.type==='add'?'新增电话机':'编辑电话机'
        }
        if(this.select_equip_type === 'camera'){
          this.equip_edit_form.title = this.equip_edit_form.type==='add'?'新增摄像头':'编辑摄像头'
        }
        if(this.select_equip_type === 'meal'){
          this.equip_edit_form.title = this.equip_edit_form.type==='add'?'新增售饭机':'编辑售饭机'
        }
        if(this.select_equip_type === 'led'){
          this.equip_edit_form.title = this.equip_edit_form.type==='add'?'新增LED':'编辑LED'
        }
      }
      if (!val) {
        this.equip_edit_form.equ_type = ''
        this.equip_edit_form.att_type = ''
        this.equip_edit_form.att_inout = ''
        this.equip_edit_form.equ_provider = ''
        this.equip_edit_form.equ_vendor = ''
        this.equip_edit_form.equ_name = ''
        this.equip_edit_form.equ_desc = ''
        this.equip_edit_form.equ_position = ''
        this.equip_edit_form.apn_sim = ''
        this.equip_edit_form.server_ip = ''
        this.equip_edit_form.server_port = ''
        this.equip_edit_form.soft_ver = ''
        this.equip_edit_form.hard_ver = ''
        this.equip_edit_form.real_exists_flag = '1'
        this.equip_edit_form.equ_id = ''
        this.equip_edit_form.permit_att = '0'
        this.equip_edit_form.gra_id = ''
        this.equip_edit_form.cls_id = ''
        this.equip_edit_form.rtsp = ''
        this.equip_edit_form.hls = ''
        this.equip_edit_form.rtmp = ''
        this.equip_edit_form.camera_status = '0'
        this.equip_edit_form.camera_use_type = ''
        this.equip_edit_form.tea_control_flag = ''
        this.equip_edit_form.camera_scheme = ''
        this.edit_camera_gra_id = ''
        this.equip_edit_form.type = 'add'
      }
    },
    edit_camera_gra_id(val) {
      if (val) {
        this.edit_camera_equip_class_dic = this.gra_dic[val].classes
        this.equip_edit_form.gra_id = val
        this.equip_edit_form.cls_id = ''
      }
    }
  },
  methods: {
    // 获取按钮权限
    permissionAuth() {
      this.auth.att_save = this.permission.indexOf('/api/pajx/equip/att/save')
      this.auth.att_update = this.permission.indexOf('/api/pajx/equip/att/update')
      this.auth.att_delete = this.permission.indexOf('/api/pajx/equip/att/delete')
      this.auth.tel_save = this.permission.indexOf('/api/pajx/equip/tel/save')
      this.auth.tel_update = this.permission.indexOf('/api/pajx/equip/tel/update')
      this.auth.tel_delete = this.permission.indexOf('/api/pajx/equip/tel/delete')
      this.auth.camera_save = this.permission.indexOf('/api/pajx/equip/camera/save')
      this.auth.camera_update = this.permission.indexOf('/api/pajx/equip/camera/update')
      this.auth.camera_delete = this.permission.indexOf('/api/pajx/equip/camera/delete')
      this.auth.meal_save = this.permission.indexOf('/api/pajx/equip/meal/save')
      this.auth.meal_update = this.permission.indexOf('/api/pajx/equip/meal/update')
      this.auth.meal_delete = this.permission.indexOf('/api/pajx/equip/meal/delete')
      this.auth.led_save = this.permission.indexOf('/api/pajx/equip/led/save')
      this.auth.led_update = this.permission.indexOf('/api/pajx/equip/led/update')
      this.auth.led_delete = this.permission.indexOf('/api/pajx/equip/led/delete')
    },
    // 重置搜索选项
    resetData() {
      Object.assign(this.$data.search, this.$options.data().search)
      this.search.hxy_scl_id = ''
      this.search.hxy_scl_name = ''
    },
    // 选择学校
    selectSchool(data) {
      this.schoolVisible = false
      this.search.hxy_scl_id = data.hxy_scl_id
      this.search.hxy_scl_name = data.scl_name
      this.equip_edit_form.hxy_scl_id = data.hxy_scl_id
      this.searchSubmit()
      gra(data.hxy_scl_id).then(response => {
        this.gra_dic = formatClass(response.data)
      })
    },
    // 获取字典列表
    getDicData() {
      equ_type_att().then(response => {
        this.equ_type_att_dic = response.data
      })
      att_type().then(response => {
        this.att_type_dic = response.data
      })
      att_inout().then(response => {
        this.att_inout_dic = response.data
      })
      equ_provider().then(response => {
        this.equ_provider_dic = response.data
      })
      equ_vendor().then(response => {
        this.equ_vendor_dic = response.data
      })
      equ_type_tel().then(response => {
        this.equ_type_tel_dic = response.data
      })
      equ_type_camera().then(response => {
        this.equ_type_camera_dic = response.data
      })
      camera_use_type().then(response => {
        this.camera_use_type_dic = response.data
      })
      camera_scheme().then(response => {
        this.camera_scheme_dic = response.data
      })
      equ_type_meal().then(response => {
        this.equ_type_meal_dic = response.data
      })
      equ_type_led().then(response => {
        this.equ_type_led_dic = response.data
      })
    },
    // 提交搜索
    searchSubmit() {
      if(!this.search.hxy_scl_id){
        this.$message({
          message: '请选选择学校',
          type: 'warning'
        })
        return
      }
      this.getAttEquipPaginateData()
      this.getTelEquipPaginateData()
      this.getCameraEquipPaginateData()
      this.getMealEquipPaginateData()
      this.getLedEquipPaginateData()
    },
    // 新增编辑设备
    setEquipEditVisible() {
      if(!this.equip_edit_form.hxy_scl_id){
        this.$message({
          message: '请选择学校',
          type: 'warning'
        })
        return
      }
      this.equipEditVisible = true
    },
    equipEditSubmit() {
      // 新增
      if (this.equip_edit_form.type === 'add') {
        // 考勤机
        if(this.select_equip_type === 'att'){
          attSave(this.equip_edit_form).then(response => {
            this.equipEditVisible = false
            this.$message({
              message: '操作成功',
              type: 'success'
            })
            this.getAttEquipPaginateData()
          })
        }
        // 电话机
        if(this.select_equip_type === 'tel'){
          telSave(this.equip_edit_form).then(response => {
            this.equipEditVisible = false
            this.$message({
              message: '操作成功',
              type: 'success'
            })
            this.getTelEquipPaginateData()
          })
        }
        // 摄像头
        if(this.select_equip_type === 'camera'){
          cameraSave(this.equip_edit_form).then(response => {
            this.equipEditVisible = false
            this.$message({
              message: '操作成功',
              type: 'success'
            })
            this.getCameraEquipPaginateData()
          })
        }
        // 售饭机
        if(this.select_equip_type === 'meal'){
          mealSave(this.equip_edit_form).then(response => {
            this.equipEditVisible = false
            this.$message({
              message: '操作成功',
              type: 'success'
            })
            this.getMealEquipPaginateData()
          })
        }
        // LED
        if(this.select_equip_type === 'led'){
          ledSave(this.equip_edit_form).then(response => {
            this.equipEditVisible = false
            this.$message({
              message: '操作成功',
              type: 'success'
            })
            this.getLedEquipPaginateData()
          })
        }
      }
      // 修改
      if (this.equip_edit_form.type === 'edit') {
        // 考勤机
        if(this.select_equip_type === 'att'){
          attUpdate(this.equip_edit_form).then(response => {
            this.equipEditVisible = false
            this.$message({
              message: '操作成功',
              type: 'success'
            })
            this.getAttEquipPaginateData()
          })
        }
        // 电话机
        if(this.select_equip_type === 'tel'){
          telUpdate(this.equip_edit_form).then(response => {
            this.equipEditVisible = false
            this.$message({
              message: '操作成功',
              type: 'success'
            })
            this.getTelEquipPaginateData()
          })
        }
        // 摄像头
        if(this.select_equip_type === 'camera'){
          cameraUpdate(this.equip_edit_form).then(response => {
            this.equipEditVisible = false
            this.$message({
              message: '操作成功',
              type: 'success'
            })
            this.getCameraEquipPaginateData()
          })
        }
        // 售饭机
        if(this.select_equip_type === 'meal'){
          mealUpdate(this.equip_edit_form).then(response => {
            this.equipEditVisible = false
            this.$message({
              message: '操作成功',
              type: 'success'
            })
            this.getMealEquipPaginateData()
          })
        }
        // LED
        if(this.select_equip_type === 'led'){
          ledUpdate(this.equip_edit_form).then(response => {
            this.equipEditVisible = false
            this.$message({
              message: '操作成功',
              type: 'success'
            })
            this.getLedEquipPaginateData()
          })
        }
      }
    },
    // 获取考勤设备列表数据
    getAttEquipPaginateData() {
      attPaginate(this.search, this.att_page, this.att_page_size).then(response => {
        this.att_equip_paginate_data = response.data.list
        this.att_total = response.data.totalRow 
      })
    },
    // 获取考勤设备详情
    getAttEquipDetail(equ_id) {
      attDetail(equ_id).then(response => {
        this.equipEditVisible = true
        this.equip_edit_form.equ_id = response.data.equ_id
        this.equip_edit_form.equ_type = response.data.equ_type
        this.equip_edit_form.att_type = response.data.att_type
        this.equip_edit_form.att_inout = response.data.att_inout
        this.equip_edit_form.equ_provider = response.data.equ_provider
        this.equip_edit_form.equ_vendor = response.data.equ_vendor
        this.equip_edit_form.equ_name = response.data.equ_name
        this.equip_edit_form.equ_desc = response.data.equ_desc
        this.equip_edit_form.equ_position = response.data.equ_position
        this.equip_edit_form.apn_sim = response.data.apn_sim
        this.equip_edit_form.server_ip = response.data.server_ip
        this.equip_edit_form.server_port = response.data.server_port
        this.equip_edit_form.soft_ver = response.data.soft_ver
        this.equip_edit_form.hard_ver = response.data.hard_ver
        this.equip_edit_form.real_exists_flag = response.data.real_exists_flag
        this.equip_edit_form.type = 'edit'
      })
    },
    // 删除考勤设备
    attEquipDelete(equ_id) {
      this.$confirm('确认要删除该设备吗？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        attDelete(equ_id).then(response => {
          this.$message({
            message: '操作成功',
            type: 'success'
          })
          this.getAttEquipPaginateData()
        })
      }).catch(() => {})
    },
    // 获取电话机设备列表数据
    getTelEquipPaginateData() {
      telPaginate(this.search, this.tel_page, this.tel_page_size).then(response => {
        this.tel_equip_paginate_data = response.data.list
        this.tel_total = response.data.totalRow 
      })
    },
    // 获取电话机设备详情
    getTelEquipDetail(equ_id) {
      telDetail(equ_id).then(response => {
        this.equipEditVisible = true
        this.equip_edit_form.equ_id = response.data.equ_id
        this.equip_edit_form.equ_type = response.data.equ_type
        this.equip_edit_form.equ_provider = response.data.equ_provider
        this.equip_edit_form.equ_vendor = response.data.equ_vendor
        this.equip_edit_form.equ_name = response.data.equ_name
        this.equip_edit_form.equ_desc = response.data.equ_desc
        this.equip_edit_form.equ_position = response.data.equ_position
        this.equip_edit_form.apn_sim = response.data.apn_sim
        this.equip_edit_form.server_ip = response.data.server_ip
        this.equip_edit_form.server_port = response.data.server_port
        this.equip_edit_form.soft_ver = response.data.soft_ver
        this.equip_edit_form.hard_ver = response.data.hard_ver
        this.equip_edit_form.real_exists_flag = response.data.real_exists_flag
        this.equip_edit_form.permit_att = response.data.permit_att
        this.equip_edit_form.type = 'edit'
      })
    },
    // 删除电话机设备
    telEquipDelete(equ_id) {
      this.$confirm('确认要删除该设备吗？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        telDelete(equ_id).then(response => {
          this.$message({
            message: '操作成功',
            type: 'success'
          })
          this.getTelEquipPaginateData()
        })
      }).catch(() => {})
    },
    // 获取摄像头设备列表数据
    getCameraEquipPaginateData() {
      cameraPaginate(this.search, this.camera_page, this.camera_page_size).then(response => {
        this.camera_equip_paginate_data = response.data.list
        this.camera_total = response.data.totalRow 
      })
    },
    // 获取摄像头设备详情
    getCameraEquipDetail(equ_id) {
      cameraDetail(equ_id).then(response => {
        var that = this
        this.equipEditVisible = true
        this.edit_camera_gra_id = response.data.gra_id
        this.equip_edit_form.equ_id = response.data.equ_id
        this.equip_edit_form.equ_type = response.data.equ_type
        this.equip_edit_form.equ_provider = response.data.equ_provider
        this.equip_edit_form.equ_vendor = response.data.equ_vendor
        this.equip_edit_form.gra_id = response.data.gra_id
        setTimeout(function(){
          that.equip_edit_form.cls_id = response.data.cls_id
        },500)
        this.equip_edit_form.equ_name = response.data.equ_name
        this.equip_edit_form.equ_desc = response.data.equ_desc
        this.equip_edit_form.equ_position = response.data.equ_position
        this.equip_edit_form.rtsp = response.data.rtsp
        this.equip_edit_form.hls = response.data.hls
        this.equip_edit_form.rtmp = response.data.rtmp
        this.equip_edit_form.camera_status = response.data.camera_status
        this.equip_edit_form.camera_use_type = response.data.camera_use_type
        this.equip_edit_form.tea_control_flag = response.data.tea_control_flag
        this.equip_edit_form.camera_scheme = response.data.camera_scheme
        this.equip_edit_form.type = 'edit'
      })
    },
    // 删除摄像头设备
    cameraEquipDelete(equ_id) {
      this.$confirm('确认要删除该设备吗？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        cameraDelete(equ_id).then(response => {
          this.$message({
            message: '操作成功',
            type: 'success'
          })
          this.getCameraEquipPaginateData()
        })
      }).catch(() => {})
    },
    // 获取售饭机列表数据
    getMealEquipPaginateData() {
      mealPaginate(this.search, this.meal_page, this.meal_page_size).then(response => {
        this.meal_equip_paginate_data = response.data.list
        this.meal_total = response.data.totalRow 
      })
    },
    // 获取售饭机设备详情
    getMealEquipDetail(equ_id) {
      mealDetail(equ_id).then(response => {
        this.equipEditVisible = true
        this.equip_edit_form.equ_id = response.data.equ_id
        this.equip_edit_form.equ_type = response.data.equ_type
        this.equip_edit_form.equ_provider = response.data.equ_provider
        this.equip_edit_form.equ_vendor = response.data.equ_vendor
        this.equip_edit_form.equ_name = response.data.equ_name
        this.equip_edit_form.equ_desc = response.data.equ_desc
        this.equip_edit_form.equ_position = response.data.equ_position
        this.equip_edit_form.type = 'edit'
      })
    },
    // 删除售饭机设备
    mealEquipDelete(equ_id) {
      this.$confirm('确认要删除该设备吗？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        mealDelete(equ_id).then(response => {
          this.$message({
            message: '操作成功',
            type: 'success'
          })
          this.getMealEquipPaginateData()
        })
      }).catch(() => {})
    },
    // 获取led设备列表数据
    getLedEquipPaginateData() {
      ledPaginate(this.search, this.led_page, this.led_page_size).then(response => {
        this.led_equip_paginate_data = response.data.list
        this.led_total = response.data.totalRow 
      })
    },
    // 获取led设备详情
    getLedEquipDetail(equ_id) {
      ledDetail(equ_id).then(response => {
        this.equipEditVisible = true
        this.equip_edit_form.equ_id = response.data.equ_id
        this.equip_edit_form.equ_type = response.data.equ_type
        this.equip_edit_form.equ_provider = response.data.equ_provider
        this.equip_edit_form.equ_vendor = response.data.equ_vendor
        this.equip_edit_form.equ_name = response.data.equ_name
        this.equip_edit_form.equ_desc = response.data.equ_desc
        this.equip_edit_form.equ_position = response.data.equ_position
        this.equip_edit_form.type = 'edit'
      })
    },
    // 删除led设备
    ledEquipDelete(equ_id) {
      this.$confirm('确认要删除该设备吗？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        ledDelete(equ_id).then(response => {
          this.$message({
            message: '操作成功',
            type: 'success'
          })
          this.getLedEquipPaginateData()
        })
      }).catch(() => {})
    }
  },
  created() {
    this.permissionAuth()
    this.getDicData()
  }
}
</script>
<style lang="scss">
  .content_view{
    border-radius: 5px;
    padding: 0;
    .content_left{
      font-size: 14px;
      border-right: 1px solid #E1E3E6;
      display: inline-block;
      background: #F5F7FA;
      div{
        padding: 0 20px;
        line-height: 50px;
        border-right: 5px #ddd #000;
        border-bottom: 1px solid #E1E3E6;
        img{
          width: 20px;
          position: relative;
          top: 4px;
          margin-right: 10px;
        }
      }
    }
    .active{
      border-right: 3px solid #3399FF;
      background: #E9F4FF;
      color: #3399FF;
    }
    .content_right{
      padding: 16x 0;
      .model_header{
        text-align: right;
        padding-bottom: 10px;
      }
    }
  }
</style>
